<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pybindgen.typehandlers.codesink</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pybindgen-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pybindgen-module.html">Package&nbsp;pybindgen</a> ::
        <a href="pybindgen.typehandlers-module.html">Package&nbsp;typehandlers</a> ::
        Module&nbsp;codesink
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pybindgen.typehandlers.codesink-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pybindgen.typehandlers.codesink-module.html">Module pybindgen.typehandlers.codesink</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-docstring">Objects that receive generated C/C++ code lines, reindents them, and</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-docstring">writes them to a file, memory, or another code sink object.</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt id="link-0" class="py-name" targets="Variable pybindgen.typehandlers.codesink.DEBUG=pybindgen.typehandlers.codesink-module.html#DEBUG,Variable pybindgen.typehandlers.ctypeparser.tokenizer.DEBUG=pybindgen.typehandlers.ctypeparser.tokenizer-module.html#DEBUG"><a title="pybindgen.typehandlers.codesink.DEBUG
pybindgen.typehandlers.ctypeparser.tokenizer.DEBUG" class="py-name" href="#" onclick="return doclink('link-0', 'DEBUG', 'link-0');">DEBUG</a></tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt id="link-1" class="py-name"><a title="pybindgen.typehandlers.codesink.DEBUG
pybindgen.typehandlers.ctypeparser.tokenizer.DEBUG" class="py-name" href="#" onclick="return doclink('link-1', 'DEBUG', 'link-0');">DEBUG</a></tt><tt class="py-op">:</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line">    <tt class="py-keyword">import</tt> <tt class="py-name">traceback</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line">    <tt class="py-keyword">import</tt> <tt class="py-name">sys</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"> </tt>
<a name="CodeSink"></a><div id="CodeSink-def"><a name="L12"></a><tt class="py-lineno"> 12</tt> <a class="py-toggle" href="#" id="CodeSink-toggle" onclick="return toggle('CodeSink');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.CodeSink-class.html">CodeSink</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CodeSink-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="CodeSink-expanded"><a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line">    <tt class="py-docstring">"""Abstract base class for code sinks"""</tt> </tt>
<a name="CodeSink.__init__"></a><div id="CodeSink.__init__-def"><a name="L14"></a><tt class="py-lineno"> 14</tt> <a class="py-toggle" href="#" id="CodeSink.__init__-toggle" onclick="return toggle('CodeSink.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.CodeSink-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CodeSink.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CodeSink.__init__-expanded"><a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line">        <tt class="py-docstring">r'''Constructor</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink = MemoryCodeSink()</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink.writeln("foo();")</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink.writeln("if (true) {")</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink.indent()</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink.writeln("bar();")</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink.unindent()</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink.writeln("zbr();")</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; print sink.flush().rstrip()</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-docstring">        foo();</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-docstring">        if (true) {</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-docstring">            bar();</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-docstring">        zbr();</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink = MemoryCodeSink()</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink.writeln("foo();")</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink.writeln()</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; sink.writeln("bar();")</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; print len(sink.flush().split("\n"))</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-docstring">        4</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">indent_level</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> <tt class="py-comment"># current indent level</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">indent_stack</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># previous indent levels</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-2" class="py-name"><a title="pybindgen.typehandlers.codesink.DEBUG
pybindgen.typehandlers.ctypeparser.tokenizer.DEBUG" class="py-name" href="#" onclick="return doclink('link-2', 'DEBUG', 'link-0');">DEBUG</a></tt><tt class="py-op">:</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_last_unindent_stack</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> <tt class="py-comment"># for debugging</tt> </tt>
</div><a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"> </tt>
<a name="CodeSink._format_code"></a><div id="CodeSink._format_code-def"><a name="L42"></a><tt class="py-lineno"> 42</tt> <a class="py-toggle" href="#" id="CodeSink._format_code-toggle" onclick="return toggle('CodeSink._format_code');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.CodeSink-class.html#_format_code">_format_code</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">code</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CodeSink._format_code-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CodeSink._format_code-expanded"><a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">        <tt class="py-docstring">"""Utility method for subclasses to use for formatting code</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-docstring">        (splits lines and indents them)"""</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">code</tt><tt class="py-op">,</tt> <tt class="py-name">basestring</tt><tt class="py-op">)</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">        <tt class="py-name">l</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt class="py-name">code</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">            <tt class="py-name">l</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-string">' '</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">indent_level</tt> <tt class="py-op">+</tt> <tt class="py-name">line</tt><tt class="py-op">)</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">l</tt> </tt>
</div><a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"> </tt>
<a name="CodeSink.writeln"></a><div id="CodeSink.writeln-def"><a name="L51"></a><tt class="py-lineno"> 51</tt> <a class="py-toggle" href="#" id="CodeSink.writeln-toggle" onclick="return toggle('CodeSink.writeln');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.CodeSink-class.html#writeln">writeln</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">line</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CodeSink.writeln-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CodeSink.writeln-expanded"><a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">        <tt class="py-docstring">"""Write one or more lines of code"""</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt class="py-name">NotImplementedError</tt> </tt>
</div><a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line"> </tt>
<a name="CodeSink.indent"></a><div id="CodeSink.indent-def"><a name="L55"></a><tt class="py-lineno"> 55</tt> <a class="py-toggle" href="#" id="CodeSink.indent-toggle" onclick="return toggle('CodeSink.indent');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.CodeSink-class.html#indent">indent</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">level</tt><tt class="py-op">=</tt><tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CodeSink.indent-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CodeSink.indent-expanded"><a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">        <tt class="py-docstring">'''Add a certain ammount of indentation to all lines written</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line"><tt class="py-docstring">        from now on and until unindent() is called'''</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">indent_stack</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">indent_level</tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">indent_level</tt> <tt class="py-op">+=</tt> <tt class="py-name">level</tt> </tt>
</div><a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line"> </tt>
<a name="CodeSink.unindent"></a><div id="CodeSink.unindent-def"><a name="L61"></a><tt class="py-lineno"> 61</tt> <a class="py-toggle" href="#" id="CodeSink.unindent-toggle" onclick="return toggle('CodeSink.unindent');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.CodeSink-class.html#unindent">unindent</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CodeSink.unindent-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CodeSink.unindent-expanded"><a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">        <tt class="py-docstring">'''Revert indentation level to the value before last indent() call'''</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-3" class="py-name"><a title="pybindgen.typehandlers.codesink.DEBUG
pybindgen.typehandlers.ctypeparser.tokenizer.DEBUG" class="py-name" href="#" onclick="return doclink('link-3', 'DEBUG', 'link-0');">DEBUG</a></tt><tt class="py-op">:</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">indent_level</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">indent_stack</tt><tt class="py-op">.</tt><tt class="py-name">pop</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">IndexError</tt><tt class="py-op">:</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_last_unindent_stack</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">                    <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt class="py-name">traceback</tt><tt class="py-op">.</tt><tt class="py-name">format_list</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_last_unindent_stack</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">                        <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">stderr</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">)</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_last_unindent_stack</tt> <tt class="py-op">=</tt> <tt class="py-name">traceback</tt><tt class="py-op">.</tt><tt class="py-name">extract_stack</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">indent_level</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">indent_stack</tt><tt class="py-op">.</tt><tt class="py-name">pop</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"> </tt>
<a name="FileCodeSink"></a><div id="FileCodeSink-def"><a name="L76"></a><tt class="py-lineno"> 76</tt> <a class="py-toggle" href="#" id="FileCodeSink-toggle" onclick="return toggle('FileCodeSink');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.FileCodeSink-class.html">FileCodeSink</a><tt class="py-op">(</tt><tt class="py-base-class">CodeSink</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="FileCodeSink-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="FileCodeSink-expanded"><a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">    <tt class="py-docstring">"""A code sink that writes to a file-like object"""</tt> </tt>
<a name="FileCodeSink.__init__"></a><div id="FileCodeSink.__init__-def"><a name="L78"></a><tt class="py-lineno"> 78</tt> <a class="py-toggle" href="#" id="FileCodeSink.__init__-toggle" onclick="return toggle('FileCodeSink.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.FileCodeSink-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">file_</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="FileCodeSink.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="FileCodeSink.__init__-expanded"><a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-docstring">        Keyword Arguments:</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-docstring">        file_ -- a file like object</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">        <tt id="link-4" class="py-name" targets="Class pybindgen.typehandlers.codesink.CodeSink=pybindgen.typehandlers.codesink.CodeSink-class.html"><a title="pybindgen.typehandlers.codesink.CodeSink" class="py-name" href="#" onclick="return doclink('link-4', 'CodeSink', 'link-4');">CodeSink</a></tt><tt class="py-op">.</tt><tt id="link-5" class="py-name" targets="Method pybindgen.container.Container.__init__()=pybindgen.container.Container-class.html#__init__,Method pybindgen.container.ContainerParameterBase.__init__()=pybindgen.container.ContainerParameterBase-class.html#__init__,Method pybindgen.container.ContainerPtrParameter.__init__()=pybindgen.container.ContainerPtrParameter-class.html#__init__,Method pybindgen.container.ContainerReturnValue.__init__()=pybindgen.container.ContainerReturnValue-class.html#__init__,Method pybindgen.container.ContainerReturnValueBase.__init__()=pybindgen.container.ContainerReturnValueBase-class.html#__init__,Method pybindgen.container.ContainerTraits.__init__()=pybindgen.container.ContainerTraits-class.html#__init__,Method pybindgen.container.IterNextWrapper.__init__()=pybindgen.container.IterNextWrapper-class.html#__init__,Method pybindgen.converter_functions.CToPythonConverter.__init__()=pybindgen.converter_functions.CToPythonConverter-class.html#__init__,Method pybindgen.converter_functions.PythonToCConverter.__init__()=pybindgen.converter_functions.PythonToCConverter-class.html#__init__,Method pybindgen.cppattribute.CppInstanceAttributeGetter.__init__()=pybindgen.cppattribute.CppInstanceAttributeGetter-class.html#__init__,Method pybindgen.cppattribute.CppInstanceAttributeSetter.__init__()=pybindgen.cppattribute.CppInstanceAttributeSetter-class.html#__init__,Method pybindgen.cppattribute.CppStaticAttributeGetter.__init__()=pybindgen.cppattribute.CppStaticAttributeGetter-class.html#__init__,Method pybindgen.cppattribute.CppStaticAttributeSetter.__init__()=pybindgen.cppattribute.CppStaticAttributeSetter-class.html#__init__,Method pybindgen.cppattribute.PyGetSetDef.__init__()=pybindgen.cppattribute.PyGetSetDef-class.html#__init__,Method pybindgen.cppattribute.PyMetaclass.__init__()=pybindgen.cppattribute.PyMetaclass-class.html#__init__,Method pybindgen.cppclass.CppClass.__init__()=pybindgen.cppclass.CppClass-class.html#__init__,Method pybindgen.cppclass.CppHelperClass.__init__()=pybindgen.cppclass.CppHelperClass-class.html#__init__,Method pybindgen.cppclass.FreeFunctionPolicy.__init__()=pybindgen.cppclass.FreeFunctionPolicy-class.html#__init__,Method pybindgen.cppclass.MemoryPolicy.__init__()=pybindgen.cppclass.MemoryPolicy-class.html#__init__,Method pybindgen.cppclass.ReferenceCountingFunctionsPolicy.__init__()=pybindgen.cppclass.ReferenceCountingFunctionsPolicy-class.html#__init__,Method pybindgen.cppclass.ReferenceCountingMethodsPolicy.__init__()=pybindgen.cppclass.ReferenceCountingMethodsPolicy-class.html#__init__,Method pybindgen.cppclass_typehandlers.CppClassParameterBase.__init__()=pybindgen.cppclass_typehandlers.CppClassParameterBase-class.html#__init__,Method pybindgen.cppclass_typehandlers.CppClassPtrParameter.__init__()=pybindgen.cppclass_typehandlers.CppClassPtrParameter-class.html#__init__,Method pybindgen.cppclass_typehandlers.CppClassPtrReturnValue.__init__()=pybindgen.cppclass_typehandlers.CppClassPtrReturnValue-class.html#__init__,Method pybindgen.cppclass_typehandlers.CppClassRefParameter.__init__()=pybindgen.cppclass_typehandlers.CppClassRefParameter-class.html#__init__,Method pybindgen.cppclass_typehandlers.CppClassReturnValue.__init__()=pybindgen.cppclass_typehandlers.CppClassReturnValue-class.html#__init__,Method pybindgen.cppclass_typehandlers.CppClassReturnValueBase.__init__()=pybindgen.cppclass_typehandlers.CppClassReturnValueBase-class.html#__init__,Method pybindgen.cppmethod.CppConstructor.__init__()=pybindgen.cppmethod.CppConstructor-class.html#__init__,Method pybindgen.cppmethod.CppDummyMethod.__init__()=pybindgen.cppmethod.CppDummyMethod-class.html#__init__,Method pybindgen.cppmethod.CppFunctionAsConstructor.__init__()=pybindgen.cppmethod.CppFunctionAsConstructor-class.html#__init__,Method pybindgen.cppmethod.CppMethod.__init__()=pybindgen.cppmethod.CppMethod-class.html#__init__,Method pybindgen.cppmethod.CppNoConstructor.__init__()=pybindgen.cppmethod.CppNoConstructor-class.html#__init__,Method pybindgen.cppmethod.CppVirtualMethodParentCaller.__init__()=pybindgen.cppmethod.CppVirtualMethodParentCaller-class.html#__init__,Method pybindgen.cppmethod.CppVirtualMethodProxy.__init__()=pybindgen.cppmethod.CppVirtualMethodProxy-class.html#__init__,Method pybindgen.cppmethod.CustomCppConstructorWrapper.__init__()=pybindgen.cppmethod.CustomCppConstructorWrapper-class.html#__init__,Method pybindgen.cppmethod.CustomCppMethodWrapper.__init__()=pybindgen.cppmethod.CustomCppMethodWrapper-class.html#__init__,Method pybindgen.cppmethod.DummyParameter.__init__()=pybindgen.cppmethod.DummyParameter-class.html#__init__,Method pybindgen.cppmethod.DummyReturnValue.__init__()=pybindgen.cppmethod.DummyReturnValue-class.html#__init__,Method pybindgen.enum.Enum.__init__()=pybindgen.enum.Enum-class.html#__init__,Method pybindgen.function.CustomFunctionWrapper.__init__()=pybindgen.function.CustomFunctionWrapper-class.html#__init__,Method pybindgen.function.Function.__init__()=pybindgen.function.Function-class.html#__init__,Method pybindgen.gccxmlparser.AnnotationsScanner.__init__()=pybindgen.gccxmlparser.AnnotationsScanner-class.html#__init__,Method pybindgen.gccxmlparser.GccXmlTypeRegistry.__init__()=pybindgen.gccxmlparser.GccXmlTypeRegistry-class.html#__init__,Method pybindgen.gccxmlparser.ModuleParser.__init__()=pybindgen.gccxmlparser.ModuleParser-class.html#__init__,Method pybindgen.gccxmlparser.PygenSection.__init__()=pybindgen.gccxmlparser.PygenSection-class.html#__init__,Method pybindgen.module.Module.__init__()=pybindgen.module.Module-class.html#__init__,Method pybindgen.module.ModuleBase.__init__()=pybindgen.module.ModuleBase-class.html#__init__,Method pybindgen.module.SubModule.__init__()=pybindgen.module.SubModule-class.html#__init__,Method pybindgen.overloading.OverloadedWrapper.__init__()=pybindgen.overloading.OverloadedWrapper-class.html#__init__,Method pybindgen.pytypeobject.PyNumberMethods.__init__()=pybindgen.pytypeobject.PyNumberMethods-class.html#__init__,Method pybindgen.pytypeobject.PySequenceMethods.__init__()=pybindgen.pytypeobject.PySequenceMethods-class.html#__init__,Method pybindgen.pytypeobject.PyTypeObject.__init__()=pybindgen.pytypeobject.PyTypeObject-class.html#__init__,Method pybindgen.typehandlers.base.BuildValueParameters.__init__()=pybindgen.typehandlers.base.BuildValueParameters-class.html#__init__,Method pybindgen.typehandlers.base.CodeBlock.CleanupHandle.__init__()=pybindgen.typehandlers.base.CodeBlock.CleanupHandle-class.html#__init__,Method pybindgen.typehandlers.base.CodeBlock.__init__()=pybindgen.typehandlers.base.CodeBlock-class.html#__init__,Method pybindgen.typehandlers.base.DeclarationsScope.__init__()=pybindgen.typehandlers.base.DeclarationsScope-class.html#__init__,Method pybindgen.typehandlers.base.ForwardWrapperBase.__init__()=pybindgen.typehandlers.base.ForwardWrapperBase-class.html#__init__,Method pybindgen.typehandlers.base.Parameter.__init__()=pybindgen.typehandlers.base.Parameter-class.html#__init__,Method pybindgen.typehandlers.base.Parameter.__metaclass__.__init__()=pybindgen.typehandlers.base.Parameter.__metaclass__-class.html#__init__,Method pybindgen.typehandlers.base.ParseTupleParameters.__init__()=pybindgen.typehandlers.base.ParseTupleParameters-class.html#__init__,Method pybindgen.typehandlers.base.PointerParameter.__init__()=pybindgen.typehandlers.base.PointerParameter-class.html#__init__,Method pybindgen.typehandlers.base.PointerReturnValue.__init__()=pybindgen.typehandlers.base.PointerReturnValue-class.html#__init__,Method pybindgen.typehandlers.base.ReturnValue.__init__()=pybindgen.typehandlers.base.ReturnValue-class.html#__init__,Method pybindgen.typehandlers.base.ReturnValue.__metaclass__.__init__()=pybindgen.typehandlers.base.ReturnValue.__metaclass__-class.html#__init__,Method pybindgen.typehandlers.base.ReverseWrapperBase.__init__()=pybindgen.typehandlers.base.ReverseWrapperBase-class.html#__init__,Method pybindgen.typehandlers.base.TypeHandler.__init__()=pybindgen.typehandlers.base.TypeHandler-class.html#__init__,Method pybindgen.typehandlers.base.TypeMatcher.__init__()=pybindgen.typehandlers.base.TypeMatcher-class.html#__init__,Method pybindgen.typehandlers.codesink.CodeSink.__init__()=pybindgen.typehandlers.codesink.CodeSink-class.html#__init__,Method pybindgen.typehandlers.codesink.FileCodeSink.__init__()=pybindgen.typehandlers.codesink.FileCodeSink-class.html#__init__,Method pybindgen.typehandlers.codesink.MemoryCodeSink.__init__()=pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#__init__,Method pybindgen.typehandlers.codesink.NullCodeSink.__init__()=pybindgen.typehandlers.codesink.NullCodeSink-class.html#__init__,Method pybindgen.typehandlers.ctypeparser.CType.__init__()=pybindgen.typehandlers.ctypeparser.CType-class.html#__init__,Method pybindgen.typehandlers.ctypeparser.TypeTraits.__init__()=pybindgen.typehandlers.ctypeparser.TypeTraits-class.html#__init__,Method pybindgen.typehandlers.ctypeparser.tokenizer.Token.__init__()=pybindgen.typehandlers.ctypeparser.tokenizer.Token-class.html#__init__,Method pybindgen.typehandlers.floattype.FloatPtrParam.__init__()=pybindgen.typehandlers.floattype.FloatPtrParam-class.html#__init__,Method pybindgen.typehandlers.inttype.Int8PtrParam.__init__()=pybindgen.typehandlers.inttype.Int8PtrParam-class.html#__init__,Method pybindgen.typehandlers.inttype.IntPtrParam.__init__()=pybindgen.typehandlers.inttype.IntPtrParam-class.html#__init__,Method pybindgen.typehandlers.inttype.UInt8PtrParam.__init__()=pybindgen.typehandlers.inttype.UInt8PtrParam-class.html#__init__,Method pybindgen.typehandlers.inttype.UnsignedIntPtrParam.__init__()=pybindgen.typehandlers.inttype.UnsignedIntPtrParam-class.html#__init__,Method pybindgen.typehandlers.pyobjecttype.PyObjectParam.__init__()=pybindgen.typehandlers.pyobjecttype.PyObjectParam-class.html#__init__,Method pybindgen.typehandlers.pyobjecttype.PyObjectReturnValue.__init__()=pybindgen.typehandlers.pyobjecttype.PyObjectReturnValue-class.html#__init__,Method pybindgen.wrapper_registry.NullWrapperRegistry.__init__()=pybindgen.wrapper_registry.NullWrapperRegistry-class.html#__init__,Method pybindgen.wrapper_registry.StdMapWrapperRegistry.__init__()=pybindgen.wrapper_registry.StdMapWrapperRegistry-class.html#__init__,Method pybindgen.wrapper_registry.WrapperRegistry.__init__()=pybindgen.wrapper_registry.WrapperRegistry-class.html#__init__"><a title="pybindgen.container.Container.__init__
pybindgen.container.ContainerParameterBase.__init__
pybindgen.container.ContainerPtrParameter.__init__
pybindgen.container.ContainerReturnValue.__init__
pybindgen.container.ContainerReturnValueBase.__init__
pybindgen.container.ContainerTraits.__init__
pybindgen.container.IterNextWrapper.__init__
pybindgen.converter_functions.CToPythonConverter.__init__
pybindgen.converter_functions.PythonToCConverter.__init__
pybindgen.cppattribute.CppInstanceAttributeGetter.__init__
pybindgen.cppattribute.CppInstanceAttributeSetter.__init__
pybindgen.cppattribute.CppStaticAttributeGetter.__init__
pybindgen.cppattribute.CppStaticAttributeSetter.__init__
pybindgen.cppattribute.PyGetSetDef.__init__
pybindgen.cppattribute.PyMetaclass.__init__
pybindgen.cppclass.CppClass.__init__
pybindgen.cppclass.CppHelperClass.__init__
pybindgen.cppclass.FreeFunctionPolicy.__init__
pybindgen.cppclass.MemoryPolicy.__init__
pybindgen.cppclass.ReferenceCountingFunctionsPolicy.__init__
pybindgen.cppclass.ReferenceCountingMethodsPolicy.__init__
pybindgen.cppclass_typehandlers.CppClassParameterBase.__init__
pybindgen.cppclass_typehandlers.CppClassPtrParameter.__init__
pybindgen.cppclass_typehandlers.CppClassPtrReturnValue.__init__
pybindgen.cppclass_typehandlers.CppClassRefParameter.__init__
pybindgen.cppclass_typehandlers.CppClassReturnValue.__init__
pybindgen.cppclass_typehandlers.CppClassReturnValueBase.__init__
pybindgen.cppmethod.CppConstructor.__init__
pybindgen.cppmethod.CppDummyMethod.__init__
pybindgen.cppmethod.CppFunctionAsConstructor.__init__
pybindgen.cppmethod.CppMethod.__init__
pybindgen.cppmethod.CppNoConstructor.__init__
pybindgen.cppmethod.CppVirtualMethodParentCaller.__init__
pybindgen.cppmethod.CppVirtualMethodProxy.__init__
pybindgen.cppmethod.CustomCppConstructorWrapper.__init__
pybindgen.cppmethod.CustomCppMethodWrapper.__init__
pybindgen.cppmethod.DummyParameter.__init__
pybindgen.cppmethod.DummyReturnValue.__init__
pybindgen.enum.Enum.__init__
pybindgen.function.CustomFunctionWrapper.__init__
pybindgen.function.Function.__init__
pybindgen.gccxmlparser.AnnotationsScanner.__init__
pybindgen.gccxmlparser.GccXmlTypeRegistry.__init__
pybindgen.gccxmlparser.ModuleParser.__init__
pybindgen.gccxmlparser.PygenSection.__init__
pybindgen.module.Module.__init__
pybindgen.module.ModuleBase.__init__
pybindgen.module.SubModule.__init__
pybindgen.overloading.OverloadedWrapper.__init__
pybindgen.pytypeobject.PyNumberMethods.__init__
pybindgen.pytypeobject.PySequenceMethods.__init__
pybindgen.pytypeobject.PyTypeObject.__init__
pybindgen.typehandlers.base.BuildValueParameters.__init__
pybindgen.typehandlers.base.CodeBlock.CleanupHandle.__init__
pybindgen.typehandlers.base.CodeBlock.__init__
pybindgen.typehandlers.base.DeclarationsScope.__init__
pybindgen.typehandlers.base.ForwardWrapperBase.__init__
pybindgen.typehandlers.base.Parameter.__init__
pybindgen.typehandlers.base.Parameter.__metaclass__.__init__
pybindgen.typehandlers.base.ParseTupleParameters.__init__
pybindgen.typehandlers.base.PointerParameter.__init__
pybindgen.typehandlers.base.PointerReturnValue.__init__
pybindgen.typehandlers.base.ReturnValue.__init__
pybindgen.typehandlers.base.ReturnValue.__metaclass__.__init__
pybindgen.typehandlers.base.ReverseWrapperBase.__init__
pybindgen.typehandlers.base.TypeHandler.__init__
pybindgen.typehandlers.base.TypeMatcher.__init__
pybindgen.typehandlers.codesink.CodeSink.__init__
pybindgen.typehandlers.codesink.FileCodeSink.__init__
pybindgen.typehandlers.codesink.MemoryCodeSink.__init__
pybindgen.typehandlers.codesink.NullCodeSink.__init__
pybindgen.typehandlers.ctypeparser.CType.__init__
pybindgen.typehandlers.ctypeparser.TypeTraits.__init__
pybindgen.typehandlers.ctypeparser.tokenizer.Token.__init__
pybindgen.typehandlers.floattype.FloatPtrParam.__init__
pybindgen.typehandlers.inttype.Int8PtrParam.__init__
pybindgen.typehandlers.inttype.IntPtrParam.__init__
pybindgen.typehandlers.inttype.UInt8PtrParam.__init__
pybindgen.typehandlers.inttype.UnsignedIntPtrParam.__init__
pybindgen.typehandlers.pyobjecttype.PyObjectParam.__init__
pybindgen.typehandlers.pyobjecttype.PyObjectReturnValue.__init__
pybindgen.wrapper_registry.NullWrapperRegistry.__init__
pybindgen.wrapper_registry.StdMapWrapperRegistry.__init__
pybindgen.wrapper_registry.WrapperRegistry.__init__" class="py-name" href="#" onclick="return doclink('link-5', '__init__', 'link-5');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">file</tt> <tt class="py-op">=</tt> <tt class="py-name">file_</tt> </tt>
</div><a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line"> </tt>
<a name="FileCodeSink.__repr__"></a><div id="FileCodeSink.__repr__-def"><a name="L86"></a><tt class="py-lineno"> 86</tt> <a class="py-toggle" href="#" id="FileCodeSink.__repr__-toggle" onclick="return toggle('FileCodeSink.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.FileCodeSink-class.html#__repr__">__repr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="FileCodeSink.__repr__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="FileCodeSink.__repr__-expanded"><a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">"&lt;pybindgen.typehandlers.codesink.FileCodeSink %r&gt;"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Variable pybindgen.module.ModuleBase.name=pybindgen.module.ModuleBase-class.html#name"><a title="pybindgen.module.ModuleBase.name" class="py-name" href="#" onclick="return doclink('link-6', 'name', 'link-6');">name</a></tt><tt class="py-op">,</tt><tt class="py-op">)</tt> </tt>
</div><a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"> </tt>
<a name="FileCodeSink.writeln"></a><div id="FileCodeSink.writeln-def"><a name="L89"></a><tt class="py-lineno"> 89</tt> <a class="py-toggle" href="#" id="FileCodeSink.writeln-toggle" onclick="return toggle('FileCodeSink.writeln');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.FileCodeSink-class.html#writeln">writeln</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">line</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="FileCodeSink.writeln-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="FileCodeSink.writeln-expanded"><a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">        <tt class="py-docstring">"""Write one or more lines of code"""</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">file</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_format_code</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">file</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line"> </tt>
<a name="MemoryCodeSink"></a><div id="MemoryCodeSink-def"><a name="L94"></a><tt class="py-lineno"> 94</tt> <a class="py-toggle" href="#" id="MemoryCodeSink-toggle" onclick="return toggle('MemoryCodeSink');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html">MemoryCodeSink</a><tt class="py-op">(</tt><tt class="py-base-class">CodeSink</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MemoryCodeSink-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="MemoryCodeSink-expanded"><a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">    <tt class="py-docstring">"""A code sink that keeps the code in memory,</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"><tt class="py-docstring">    and can later flush the code to another code sink"""</tt> </tt>
<a name="MemoryCodeSink.__init__"></a><div id="MemoryCodeSink.__init__-def"><a name="L97"></a><tt class="py-lineno"> 97</tt> <a class="py-toggle" href="#" id="MemoryCodeSink.__init__-toggle" onclick="return toggle('MemoryCodeSink.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MemoryCodeSink.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MemoryCodeSink.__init__-expanded"><a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt class="py-docstring">"Constructor"</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt id="link-7" class="py-name"><a title="pybindgen.typehandlers.codesink.CodeSink" class="py-name" href="#" onclick="return doclink('link-7', 'CodeSink', 'link-4');">CodeSink</a></tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="pybindgen.container.Container.__init__
pybindgen.container.ContainerParameterBase.__init__
pybindgen.container.ContainerPtrParameter.__init__
pybindgen.container.ContainerReturnValue.__init__
pybindgen.container.ContainerReturnValueBase.__init__
pybindgen.container.ContainerTraits.__init__
pybindgen.container.IterNextWrapper.__init__
pybindgen.converter_functions.CToPythonConverter.__init__
pybindgen.converter_functions.PythonToCConverter.__init__
pybindgen.cppattribute.CppInstanceAttributeGetter.__init__
pybindgen.cppattribute.CppInstanceAttributeSetter.__init__
pybindgen.cppattribute.CppStaticAttributeGetter.__init__
pybindgen.cppattribute.CppStaticAttributeSetter.__init__
pybindgen.cppattribute.PyGetSetDef.__init__
pybindgen.cppattribute.PyMetaclass.__init__
pybindgen.cppclass.CppClass.__init__
pybindgen.cppclass.CppHelperClass.__init__
pybindgen.cppclass.FreeFunctionPolicy.__init__
pybindgen.cppclass.MemoryPolicy.__init__
pybindgen.cppclass.ReferenceCountingFunctionsPolicy.__init__
pybindgen.cppclass.ReferenceCountingMethodsPolicy.__init__
pybindgen.cppclass_typehandlers.CppClassParameterBase.__init__
pybindgen.cppclass_typehandlers.CppClassPtrParameter.__init__
pybindgen.cppclass_typehandlers.CppClassPtrReturnValue.__init__
pybindgen.cppclass_typehandlers.CppClassRefParameter.__init__
pybindgen.cppclass_typehandlers.CppClassReturnValue.__init__
pybindgen.cppclass_typehandlers.CppClassReturnValueBase.__init__
pybindgen.cppmethod.CppConstructor.__init__
pybindgen.cppmethod.CppDummyMethod.__init__
pybindgen.cppmethod.CppFunctionAsConstructor.__init__
pybindgen.cppmethod.CppMethod.__init__
pybindgen.cppmethod.CppNoConstructor.__init__
pybindgen.cppmethod.CppVirtualMethodParentCaller.__init__
pybindgen.cppmethod.CppVirtualMethodProxy.__init__
pybindgen.cppmethod.CustomCppConstructorWrapper.__init__
pybindgen.cppmethod.CustomCppMethodWrapper.__init__
pybindgen.cppmethod.DummyParameter.__init__
pybindgen.cppmethod.DummyReturnValue.__init__
pybindgen.enum.Enum.__init__
pybindgen.function.CustomFunctionWrapper.__init__
pybindgen.function.Function.__init__
pybindgen.gccxmlparser.AnnotationsScanner.__init__
pybindgen.gccxmlparser.GccXmlTypeRegistry.__init__
pybindgen.gccxmlparser.ModuleParser.__init__
pybindgen.gccxmlparser.PygenSection.__init__
pybindgen.module.Module.__init__
pybindgen.module.ModuleBase.__init__
pybindgen.module.SubModule.__init__
pybindgen.overloading.OverloadedWrapper.__init__
pybindgen.pytypeobject.PyNumberMethods.__init__
pybindgen.pytypeobject.PySequenceMethods.__init__
pybindgen.pytypeobject.PyTypeObject.__init__
pybindgen.typehandlers.base.BuildValueParameters.__init__
pybindgen.typehandlers.base.CodeBlock.CleanupHandle.__init__
pybindgen.typehandlers.base.CodeBlock.__init__
pybindgen.typehandlers.base.DeclarationsScope.__init__
pybindgen.typehandlers.base.ForwardWrapperBase.__init__
pybindgen.typehandlers.base.Parameter.__init__
pybindgen.typehandlers.base.Parameter.__metaclass__.__init__
pybindgen.typehandlers.base.ParseTupleParameters.__init__
pybindgen.typehandlers.base.PointerParameter.__init__
pybindgen.typehandlers.base.PointerReturnValue.__init__
pybindgen.typehandlers.base.ReturnValue.__init__
pybindgen.typehandlers.base.ReturnValue.__metaclass__.__init__
pybindgen.typehandlers.base.ReverseWrapperBase.__init__
pybindgen.typehandlers.base.TypeHandler.__init__
pybindgen.typehandlers.base.TypeMatcher.__init__
pybindgen.typehandlers.codesink.CodeSink.__init__
pybindgen.typehandlers.codesink.FileCodeSink.__init__
pybindgen.typehandlers.codesink.MemoryCodeSink.__init__
pybindgen.typehandlers.codesink.NullCodeSink.__init__
pybindgen.typehandlers.ctypeparser.CType.__init__
pybindgen.typehandlers.ctypeparser.TypeTraits.__init__
pybindgen.typehandlers.ctypeparser.tokenizer.Token.__init__
pybindgen.typehandlers.floattype.FloatPtrParam.__init__
pybindgen.typehandlers.inttype.Int8PtrParam.__init__
pybindgen.typehandlers.inttype.IntPtrParam.__init__
pybindgen.typehandlers.inttype.UInt8PtrParam.__init__
pybindgen.typehandlers.inttype.UnsignedIntPtrParam.__init__
pybindgen.typehandlers.pyobjecttype.PyObjectParam.__init__
pybindgen.typehandlers.pyobjecttype.PyObjectReturnValue.__init__
pybindgen.wrapper_registry.NullWrapperRegistry.__init__
pybindgen.wrapper_registry.StdMapWrapperRegistry.__init__
pybindgen.wrapper_registry.WrapperRegistry.__init__" class="py-name" href="#" onclick="return doclink('link-8', '__init__', 'link-5');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
</div><a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line"> </tt>
<a name="MemoryCodeSink.writeln"></a><div id="MemoryCodeSink.writeln-def"><a name="L102"></a><tt class="py-lineno">102</tt> <a class="py-toggle" href="#" id="MemoryCodeSink.writeln-toggle" onclick="return toggle('MemoryCodeSink.writeln');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#writeln">writeln</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">line</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MemoryCodeSink.writeln-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MemoryCodeSink.writeln-expanded"><a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">        <tt class="py-docstring">"""Write one or more lines of code"""</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">lines</tt><tt class="py-op">.</tt><tt class="py-name">extend</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_format_code</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"> </tt>
<a name="MemoryCodeSink.flush_to"></a><div id="MemoryCodeSink.flush_to-def"><a name="L106"></a><tt class="py-lineno">106</tt> <a class="py-toggle" href="#" id="MemoryCodeSink.flush_to-toggle" onclick="return toggle('MemoryCodeSink.flush_to');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#flush_to">flush_to</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">sink</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MemoryCodeSink.flush_to-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MemoryCodeSink.flush_to-expanded"><a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        <tt class="py-docstring">"""Flushes code to another code sink</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line"><tt class="py-docstring">        sink -- another CodeSink instance</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">sink</tt><tt class="py-op">,</tt> <tt id="link-9" class="py-name"><a title="pybindgen.typehandlers.codesink.CodeSink" class="py-name" href="#" onclick="return doclink('link-9', 'CodeSink', 'link-4');">CodeSink</a></tt><tt class="py-op">)</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">lines</tt><tt class="py-op">:</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">            <tt class="py-name">sink</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Method pybindgen.typehandlers.codesink.CodeSink.writeln()=pybindgen.typehandlers.codesink.CodeSink-class.html#writeln,Method pybindgen.typehandlers.codesink.FileCodeSink.writeln()=pybindgen.typehandlers.codesink.FileCodeSink-class.html#writeln,Method pybindgen.typehandlers.codesink.MemoryCodeSink.writeln()=pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#writeln,Method pybindgen.typehandlers.codesink.NullCodeSink.writeln()=pybindgen.typehandlers.codesink.NullCodeSink-class.html#writeln"><a title="pybindgen.typehandlers.codesink.CodeSink.writeln
pybindgen.typehandlers.codesink.FileCodeSink.writeln
pybindgen.typehandlers.codesink.MemoryCodeSink.writeln
pybindgen.typehandlers.codesink.NullCodeSink.writeln" class="py-name" href="#" onclick="return doclink('link-10', 'writeln', 'link-10');">writeln</a></tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">.</tt><tt class="py-name">rstrip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
</div><a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"> </tt>
<a name="MemoryCodeSink.flush"></a><div id="MemoryCodeSink.flush-def"><a name="L115"></a><tt class="py-lineno">115</tt> <a class="py-toggle" href="#" id="MemoryCodeSink.flush-toggle" onclick="return toggle('MemoryCodeSink.flush');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#flush">flush</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MemoryCodeSink.flush-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MemoryCodeSink.flush-expanded"><a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">        <tt class="py-docstring">"Flushes the code and returns the formatted output as a return value string"</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">        <tt class="py-name">l</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">lines</tt><tt class="py-op">:</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">            <tt class="py-name">l</tt><tt class="py-op">.</tt><tt class="py-name">extend</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_format_code</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">"\n"</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">l</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-string">'\n'</tt> </tt>
</div></div><a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line"> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line"> </tt>
<a name="NullCodeSink"></a><div id="NullCodeSink-def"><a name="L124"></a><tt class="py-lineno">124</tt> <a class="py-toggle" href="#" id="NullCodeSink-toggle" onclick="return toggle('NullCodeSink');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.NullCodeSink-class.html">NullCodeSink</a><tt class="py-op">(</tt><tt class="py-base-class">CodeSink</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="NullCodeSink-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="NullCodeSink-expanded"><a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">    <tt class="py-docstring">"""A code sink that discards all content.  Useful to 'test' if code</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"><tt class="py-docstring">    generation would work without actually generating anything."""</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"> </tt>
<a name="NullCodeSink.__init__"></a><div id="NullCodeSink.__init__-def"><a name="L128"></a><tt class="py-lineno">128</tt> <a class="py-toggle" href="#" id="NullCodeSink.__init__-toggle" onclick="return toggle('NullCodeSink.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.NullCodeSink-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="NullCodeSink.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="NullCodeSink.__init__-expanded"><a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">        <tt class="py-docstring">"Constructor"</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">        <tt id="link-11" class="py-name"><a title="pybindgen.typehandlers.codesink.CodeSink" class="py-name" href="#" onclick="return doclink('link-11', 'CodeSink', 'link-4');">CodeSink</a></tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="pybindgen.container.Container.__init__
pybindgen.container.ContainerParameterBase.__init__
pybindgen.container.ContainerPtrParameter.__init__
pybindgen.container.ContainerReturnValue.__init__
pybindgen.container.ContainerReturnValueBase.__init__
pybindgen.container.ContainerTraits.__init__
pybindgen.container.IterNextWrapper.__init__
pybindgen.converter_functions.CToPythonConverter.__init__
pybindgen.converter_functions.PythonToCConverter.__init__
pybindgen.cppattribute.CppInstanceAttributeGetter.__init__
pybindgen.cppattribute.CppInstanceAttributeSetter.__init__
pybindgen.cppattribute.CppStaticAttributeGetter.__init__
pybindgen.cppattribute.CppStaticAttributeSetter.__init__
pybindgen.cppattribute.PyGetSetDef.__init__
pybindgen.cppattribute.PyMetaclass.__init__
pybindgen.cppclass.CppClass.__init__
pybindgen.cppclass.CppHelperClass.__init__
pybindgen.cppclass.FreeFunctionPolicy.__init__
pybindgen.cppclass.MemoryPolicy.__init__
pybindgen.cppclass.ReferenceCountingFunctionsPolicy.__init__
pybindgen.cppclass.ReferenceCountingMethodsPolicy.__init__
pybindgen.cppclass_typehandlers.CppClassParameterBase.__init__
pybindgen.cppclass_typehandlers.CppClassPtrParameter.__init__
pybindgen.cppclass_typehandlers.CppClassPtrReturnValue.__init__
pybindgen.cppclass_typehandlers.CppClassRefParameter.__init__
pybindgen.cppclass_typehandlers.CppClassReturnValue.__init__
pybindgen.cppclass_typehandlers.CppClassReturnValueBase.__init__
pybindgen.cppmethod.CppConstructor.__init__
pybindgen.cppmethod.CppDummyMethod.__init__
pybindgen.cppmethod.CppFunctionAsConstructor.__init__
pybindgen.cppmethod.CppMethod.__init__
pybindgen.cppmethod.CppNoConstructor.__init__
pybindgen.cppmethod.CppVirtualMethodParentCaller.__init__
pybindgen.cppmethod.CppVirtualMethodProxy.__init__
pybindgen.cppmethod.CustomCppConstructorWrapper.__init__
pybindgen.cppmethod.CustomCppMethodWrapper.__init__
pybindgen.cppmethod.DummyParameter.__init__
pybindgen.cppmethod.DummyReturnValue.__init__
pybindgen.enum.Enum.__init__
pybindgen.function.CustomFunctionWrapper.__init__
pybindgen.function.Function.__init__
pybindgen.gccxmlparser.AnnotationsScanner.__init__
pybindgen.gccxmlparser.GccXmlTypeRegistry.__init__
pybindgen.gccxmlparser.ModuleParser.__init__
pybindgen.gccxmlparser.PygenSection.__init__
pybindgen.module.Module.__init__
pybindgen.module.ModuleBase.__init__
pybindgen.module.SubModule.__init__
pybindgen.overloading.OverloadedWrapper.__init__
pybindgen.pytypeobject.PyNumberMethods.__init__
pybindgen.pytypeobject.PySequenceMethods.__init__
pybindgen.pytypeobject.PyTypeObject.__init__
pybindgen.typehandlers.base.BuildValueParameters.__init__
pybindgen.typehandlers.base.CodeBlock.CleanupHandle.__init__
pybindgen.typehandlers.base.CodeBlock.__init__
pybindgen.typehandlers.base.DeclarationsScope.__init__
pybindgen.typehandlers.base.ForwardWrapperBase.__init__
pybindgen.typehandlers.base.Parameter.__init__
pybindgen.typehandlers.base.Parameter.__metaclass__.__init__
pybindgen.typehandlers.base.ParseTupleParameters.__init__
pybindgen.typehandlers.base.PointerParameter.__init__
pybindgen.typehandlers.base.PointerReturnValue.__init__
pybindgen.typehandlers.base.ReturnValue.__init__
pybindgen.typehandlers.base.ReturnValue.__metaclass__.__init__
pybindgen.typehandlers.base.ReverseWrapperBase.__init__
pybindgen.typehandlers.base.TypeHandler.__init__
pybindgen.typehandlers.base.TypeMatcher.__init__
pybindgen.typehandlers.codesink.CodeSink.__init__
pybindgen.typehandlers.codesink.FileCodeSink.__init__
pybindgen.typehandlers.codesink.MemoryCodeSink.__init__
pybindgen.typehandlers.codesink.NullCodeSink.__init__
pybindgen.typehandlers.ctypeparser.CType.__init__
pybindgen.typehandlers.ctypeparser.TypeTraits.__init__
pybindgen.typehandlers.ctypeparser.tokenizer.Token.__init__
pybindgen.typehandlers.floattype.FloatPtrParam.__init__
pybindgen.typehandlers.inttype.Int8PtrParam.__init__
pybindgen.typehandlers.inttype.IntPtrParam.__init__
pybindgen.typehandlers.inttype.UInt8PtrParam.__init__
pybindgen.typehandlers.inttype.UnsignedIntPtrParam.__init__
pybindgen.typehandlers.pyobjecttype.PyObjectParam.__init__
pybindgen.typehandlers.pyobjecttype.PyObjectReturnValue.__init__
pybindgen.wrapper_registry.NullWrapperRegistry.__init__
pybindgen.wrapper_registry.StdMapWrapperRegistry.__init__
pybindgen.wrapper_registry.WrapperRegistry.__init__" class="py-name" href="#" onclick="return doclink('link-12', '__init__', 'link-5');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
</div><a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"> </tt>
<a name="NullCodeSink.writeln"></a><div id="NullCodeSink.writeln-def"><a name="L132"></a><tt class="py-lineno">132</tt> <a class="py-toggle" href="#" id="NullCodeSink.writeln-toggle" onclick="return toggle('NullCodeSink.writeln');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.NullCodeSink-class.html#writeln">writeln</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">line</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="NullCodeSink.writeln-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="NullCodeSink.writeln-expanded"><a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">        <tt class="py-docstring">"""Write one or more lines of code"""</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"> </tt>
<a name="NullCodeSink.flush_to"></a><div id="NullCodeSink.flush_to-def"><a name="L136"></a><tt class="py-lineno">136</tt> <a class="py-toggle" href="#" id="NullCodeSink.flush_to-toggle" onclick="return toggle('NullCodeSink.flush_to');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.NullCodeSink-class.html#flush_to">flush_to</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">sink</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="NullCodeSink.flush_to-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="NullCodeSink.flush_to-expanded"><a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">        <tt class="py-docstring">"""Flushes code to another code sink</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line"><tt class="py-docstring">        sink -- another CodeSink instance</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt class="py-name">TypeError</tt><tt class="py-op">(</tt><tt class="py-string">"Cannot flush a NullCodeSink; it has no content!"</tt><tt class="py-op">)</tt> </tt>
</div><a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line"> </tt>
<a name="NullCodeSink.flush"></a><div id="NullCodeSink.flush-def"><a name="L142"></a><tt class="py-lineno">142</tt> <a class="py-toggle" href="#" id="NullCodeSink.flush-toggle" onclick="return toggle('NullCodeSink.flush');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pybindgen.typehandlers.codesink.NullCodeSink-class.html#flush">flush</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="NullCodeSink.flush-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="NullCodeSink.flush-expanded"><a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">        <tt class="py-docstring">"Flushes the code and returns the formatted output as a return value string"</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt class="py-name">TypeError</tt><tt class="py-op">(</tt><tt class="py-string">"Cannot flush a NullCodeSink; it has no content!"</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pybindgen-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Jul 12 17:23:45 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
